home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / INSERT CHOOSEITEM.SCRIPT < prev    next >
Encoding:
Text File  |  1998-01-06  |  801 b   |  31 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. // Insert script helper for:
  5.  
  6. /**
  7. @Object: Host 
  8. @Method: chooseItem(...) displays a choose list dialog 
  9. to allow a user to choose a single item from the list.  
  10. Note the valueFunction is a callback that is used 
  11. to get the value to put in the list box from the 
  12. list.  
  13. @Syntax: chooseItem(title, message, list, selectedItem, valueFunction)
  14. @Summary: chooseItem - brings up a choose list dialog 
  15. */
  16.  
  17. // chooseItem returns the item chosen
  18.  
  19. function DoCommand()
  20. {
  21.   var editor = getActiveEditor();
  22.   if (editor)
  23.   {
  24.     var selection = editor.getSelection();
  25.     editor.replace("chooseItem(title, message, list, selectedItem, valueFunction)", selection);
  26.     editor.setActive("Insert chooseItem");
  27.   }
  28. }
  29.  
  30. !!/Script
  31.